<?php
/**
*
* @package avp
* @version $Id: $
* @copyright (c) 2006 Jan-Willem van Ganswijk, Stefan van Essen
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if(!defined('IN_SCRIPT')) {
    die();
}

function getsource($filename) {
	global $root;
    $file_ext = explode("." , $filename);
    switch(strtolower($file_ext[count($file_ext)-1])) {
        case "png":
            $return = imagecreatefrompng($root . 'images/' . $filename);
            break;
        case "jpg":
        case "jpeg":
            $return = imagecreatefromjpeg($root . 'images/' . $filename);
            break;
        case "gif":
            $return = imagecreatefromgif($root . 'images/' . $filename);
            break;
        default:
            return false;
    }
    return $return;
}

?>